Skip to content

Conversation

@efaulhaber
Copy link
Member

@efaulhaber efaulhaber commented May 11, 2024

Based on #111.

@codecov
Copy link

codecov bot commented May 11, 2024

Codecov Report

❌ Patch coverage is 66.66667% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.76%. Comparing base (9d93faf) to head (dc51ce5).

Files with missing lines Patch % Lines
src/nhs_precomputed.jl 78.78% 7 Missing ⚠️
src/gpu.jl 0.00% 6 Missing ⚠️
src/neighborhood_search.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
- Coverage   86.94%   84.76%   -2.19%     
==========================================
  Files          15       15              
  Lines         659      689      +30     
==========================================
+ Hits          573      584      +11     
- Misses         86      105      +19     
Flag Coverage Δ
unit 84.76% <66.66%> (-2.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch 2 times, most recently from 87d232f to 4fbd32d Compare May 16, 2024 15:40
@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch from 4fbd32d to eedc1e3 Compare May 29, 2024 11:18
@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch 5 times, most recently from 2209334 to 69646c3 Compare June 7, 2024 14:38
@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch from 69646c3 to ce9153f Compare June 11, 2024 14:22
@efaulhaber efaulhaber self-assigned this Nov 14, 2024
@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch 3 times, most recently from 09f5a6a to 6212b13 Compare May 26, 2025 19:55
@efaulhaber efaulhaber added the gpu label May 26, 2025
@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch from 45ddfb2 to 447f42b Compare October 27, 2025 10:42
@efaulhaber efaulhaber requested a review from Copilot November 3, 2025 13:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for using Vector{Vector} as a backend for PrecomputedNeighborhoodSearch, making it more flexible and memory-efficient for certain use cases. It also introduces a freeze_neighborhood_search function to strip unnecessary data structures when preparing neighborhood searches for GPU execution.

  • Refactored PrecomputedNeighborhoodSearch to support configurable backends (DynamicVectorOfVectors or Vector{Vector})
  • Added freeze_neighborhood_search to optimize GPU transfers by removing internal neighborhood searches
  • Introduced max_inner_length helper function to handle backend-specific configuration copying

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/nhs_precomputed.jl Refactored struct to support configurable backends, added freeze_neighborhood_search implementation
src/vector_of_vectors.jl Added max_inner_length helper for extracting backend configuration
src/neighborhood_search.jl Added generic freeze_neighborhood_search interface
src/gpu.jl Updated GPU adaptation to handle PrecomputedNeighborhoodSearch instead of GridNeighborhoodSearch
src/cell_lists/spatial_hashing.jl Fixed trailing whitespace in documentation
src/cell_lists/full_grid.jl Updated documentation and replaced max_points_per_cell with max_inner_length
benchmarks/smoothed_particle_hydrodynamics.jl Added freeze_neighborhood_search call before GPU transfer
benchmarks/n_body.jl Added freeze_neighborhood_search call before GPU transfer
benchmarks/run_benchmarks.jl Added PrecomputedNeighborhoodSearch to GPU benchmark suite
test/neighborhood_search.jl Added test cases for PrecomputedNeighborhoodSearch with Vector{Vector} backend
Comments suppressed due to low confidence (1)

src/nhs_precomputed.jl:128

  • The element type Int[] should be consistent with the backend type. When using Vector{Vector{Int32}} backend, this creates Vector{Int} elements instead of Vector{Int32}, which is inconsistent. Consider using the element type from the backend or making this type-stable.
        neighbor_lists[i] = Int[]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- `Vector{Vector{Int32}}`: Scattered memory, but very memory-efficient.
- `DynamicVectorOfVectors{Int32}`: Contiguous memory, optimizing cache-hits.
- `DynamicVectorOfVectors{Int32}`: Contiguous memory, optimizing cache-hits
and GPU compatible.
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammatical inconsistency: 'GPU compatible' should be 'GPU-compatible' to match the hyphenation style used in the PrecomputedNeighborhoodSearch documentation.

Suggested change
and GPU compatible.
and GPU-compatible.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants